
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>分支 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="version.html" />
    
    
    <link rel="prev" href="repository.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    首页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="about.html">
            
                <a href="about.html">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="repository.html">
            
                <a href="repository.html">
            
                    
                    仓库
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4" data-path="branch.html">
            
                <a href="branch.html">
            
                    
                    分支
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="version.html">
            
                <a href="version.html">
            
                    
                    版本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="flow.html">
            
                <a href="flow.html">
            
                    
                    流程
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >分支</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5206;&#x652F;-branch">&#x5206;&#x652F; Branch</h1>
<blockquote>
<p>&#x8FD9;&#x662F;Git&#x4E2D;&#x6700;&#x91CD;&#x8981;&#x7684;&#x4E5F;&#x662F;&#x6700;&#x5E38;&#x7528;&#x7684;&#x6982;&#x5FF5;&#x548C;&#x529F;&#x80FD;&#x4E4B;&#x4E00;&#xFF0C;&#x5206;&#x652F;&#x529F;&#x80FD;&#x89E3;&#x51B3;&#x4E86;&#x6B63;&#x5728;&#x5F00;&#x53D1;&#x7684;&#x7248;&#x672C;&#x4E0E;&#x4E0A;&#x7EBF;&#x7248;&#x672C;&#x7A33;&#x5B9A;&#x6027;&#x51B2;&#x7A81;&#x7684;&#x95EE;&#x9898;&#x5728;Git&#x4F7F;&#x7528;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x7684;&#x9ED8;&#x8BA4;&#x5206;&#x652F;&#x4E00;&#x822C;&#x662F;Master&#xFF0C;&#x5F53;&#x7136;&#xFF0C;&#x8FD9;&#x662F;&#x53EF;&#x4EE5;&#x4FEE;&#x6539;&#x7684;&#xFF0C;&#x6211;&#x4EEC;&#x5728;Master&#x5B8C;&#x6210;&#x4E00;&#x6B21;&#x5F00;&#x53D1;&#xFF0C;&#x751F;&#x6210;&#x4E86;&#x4E00;&#x4E2A;&#x7A33;&#x5B9A;&#x7248;&#x672C;&#xFF0C;&#x90A3;&#x4E48;&#x5F53;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x6DFB;&#x52A0;&#x65B0;&#x529F;&#x80FD;&#x6216;&#x8005;&#x505A;&#x4FEE;&#x6539;&#x65F6;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x5206;&#x652F;&#xFF0C;&#x7136;&#x540E;&#x5728;&#x8BE5;&#x5206;&#x652F;&#x4E0A;&#x5F00;&#x53D1;&#xFF0C;&#x5B8C;&#x6210;&#x540E;&#x5408;&#x5E76;&#x5230;&#x4E3B;&#x5206;&#x652F;&#x5373;&#x53EF;</p>
</blockquote>
<h2 id="&#x67E5;&#x770B;&#x5206;&#x652F;">&#x67E5;&#x770B;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">$ git branch
$ git branch <span class="hljs-_">-a</span>
</code></pre>
<h2 id="&#x521B;&#x5EFA;&#x5206;&#x652F;">&#x521B;&#x5EFA;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">// &#x5207;&#x6362;&#x5206;&#x652F;&#x524D;&#xFF0C;&#x5FC5;&#x987B;&#x5148;commit&#x5F53;&#x524D;&#x5206;&#x652F;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x5426;&#x5219;&#x4F1A;&#x51FA;&#x73B0;&#x5F02;&#x5E38;
$ git branch develop
</code></pre>
<h2 id="&#x5207;&#x6362;&#x5206;&#x652F;">&#x5207;&#x6362;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">$ git checkout develop
</code></pre>
<h2 id="&#x521B;&#x5EFA;--&#x5207;&#x6362;&#x81F3;&#x5206;&#x652F;">&#x521B;&#x5EFA; + &#x5207;&#x6362;&#x81F3;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">$ git checkout -b develop
</code></pre>
<h2 id="&#x5206;&#x652F;develop&#x5408;&#x5E76;&#x5230;&#x5F53;&#x524D;&#x5206;&#x652F;">&#x5206;&#x652F;develop&#x5408;&#x5E76;&#x5230;&#x5F53;&#x524D;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">$ git checkout master
$ git merge develop
</code></pre>
<h2 id="&#x5220;&#x9664;&#x5206;&#x652F;develop">&#x5220;&#x9664;&#x5206;&#x652F;develop</h2>
<pre><code class="lang-bash">$ git branch &#x2013;d develop
</code></pre>
<h2 id="&#x628A;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x67D0;&#x4E2A;&#x5206;&#x652F;&#x90FD;&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;">&#x628A;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x67D0;&#x4E2A;&#x5206;&#x652F;&#x90FD;&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;</h2>
<pre><code class="lang-bash">$ git push origin develop
</code></pre>
<h2 id="&#x628A;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x6240;&#x6709;&#x5206;&#x652F;&#x90FD;&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;">&#x628A;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x6240;&#x6709;&#x5206;&#x652F;&#x90FD;&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;</h2>
<pre><code class="lang-bash">$ git push --all origin
</code></pre>
<h2 id="&#x5220;&#x9664;&#x8FDC;&#x7A0B;&#x5206;&#x652F;develop">&#x5220;&#x9664;&#x8FDC;&#x7A0B;&#x5206;&#x652F;develop</h2>
<pre><code class="lang-bash">$ git push origin <span class="hljs-_">-d</span> develop
</code></pre>
<h2 id="&#x67E5;&#x770B;&#x5404;&#x4E2A;&#x672C;&#x5730;&#x5206;&#x652F;&#x9ED8;&#x8BA4;&#x63D0;&#x4EA4;&#x7684;&#x8FDC;&#x7A0B;&#x5206;&#x652F;">&#x67E5;&#x770B;&#x5404;&#x4E2A;&#x672C;&#x5730;&#x5206;&#x652F;&#x9ED8;&#x8BA4;&#x63D0;&#x4EA4;&#x7684;&#x8FDC;&#x7A0B;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">$ git branch -vv
</code></pre>
<h2 id="&#x62C9;&#x53D6;&#x8FDC;&#x7A0B;&#x5206;&#x652F;--&#x521B;&#x5EFA;--&#x5207;&#x6362;&#x81F3;&#x8BE5;&#x672C;&#x5730;&#x5206;&#x652F;">&#x62C9;&#x53D6;&#x8FDC;&#x7A0B;&#x5206;&#x652F; + &#x521B;&#x5EFA; + &#x5207;&#x6362;&#x81F3;&#x8BE5;&#x672C;&#x5730;&#x5206;&#x652F;</h2>
<pre><code class="lang-bash">$ git checkout -b &#x672C;&#x5730;&#x5206;&#x652F;&#x540D; origin/&#x8FDC;&#x7A0B;&#x5206;&#x652F;&#x540D;
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="repository.html" class="navigation navigation-prev " aria-label="Previous page: 仓库">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="version.html" class="navigation navigation-next " aria-label="Next page: 版本">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"分支","level":"1.4","depth":1,"next":{"title":"版本","level":"1.5","depth":1,"path":"version.md","ref":"version.md","articles":[]},"previous":{"title":"仓库","level":"1.3","depth":1,"path":"repository.md","ref":"repository.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"branch.md","mtime":"2017-11-29T01:47:57.112Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-11-29T01:49:36.040Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

